package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.enumclass.PacketStatus;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by zhangjh on 2016/10/28.
 */
@Entity
@Table(name = "red_packet")
@DynamicInsert
@DynamicUpdate
public class RedPacket extends IDEntityMall {
    @Column(columnDefinition = "varchar(255) comment'广告图片点解连接'")
    private String adUrl;
    @Column(columnDefinition = "datetime comment'有效期结束时间'")
    private Date dateDisabled;
    @Column(columnDefinition = "datetime comment'有效期开始时间'")
    private Date dateEnabled;
    @Column(columnDefinition = "datetime comment'生效时间'")
    private Date dateStart;
    @Column(columnDefinition = "varchar(255) comment''")
    private String identifier;
    @Column(columnDefinition = "varchar(255) comment'简介' ")
    private String intro;
    @Column(columnDefinition = "varchar(255) comment'是否分享返利'")
    @Enumerated(EnumType.STRING)
    private Whether isShareReward = Whether.NO;
    @Column(columnDefinition = "varchar(255) comment'是否关联红包'")
    @Enumerated(EnumType.STRING)
    private Whether isUnion = Whether.NO;
    @Column(columnDefinition = "bigint comment'商铺ID'")
    private Long merchantId;
    @Column(columnDefinition = "varchar(255) comment'名称'")
    private String name;
    @Column(columnDefinition = "varchar(255) comment'红包状态'")
    @Enumerated(EnumType.STRING)
    private PacketStatus status = PacketStatus.DRAFT;

    public String getAdUrl() {
        return adUrl;
    }

    public void setAdUrl(String adUrl) {
        this.adUrl = adUrl;
    }

    public Date getDateDisabled() {
        return dateDisabled;
    }

    public void setDateDisabled(Date dateDisabled) {
        this.dateDisabled = dateDisabled;
    }

    public Date getDateEnabled() {
        return dateEnabled;
    }

    public void setDateEnabled(Date dateEnabled) {
        this.dateEnabled = dateEnabled;
    }

    public Date getDateStart() {
        return dateStart;
    }

    public void setDateStart(Date dateStart) {
        this.dateStart = dateStart;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public Whether getIsShareReward() {
        return isShareReward;
    }

    public void setIsShareReward(Whether isShareReward) {
        this.isShareReward = isShareReward;
    }

    public Whether getIsUnion() {
        return isUnion;
    }

    public void setIsUnion(Whether isUnion) {
        this.isUnion = isUnion;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public PacketStatus getStatus() {
        return status;
    }

    public void setStatus(PacketStatus status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "RedPacket{" +
                "adUrl='" + adUrl + '\'' +
                ", id=" + id +
                ", dateDisabled=" + dateDisabled +
                ", dateCreated=" + dateCreated +
                ", dateEnabled=" + dateEnabled +
                ", dateStart=" + dateStart +
                ", lastUpdated=" + lastUpdated +
                ", identifier='" + identifier + '\'' +
                ", intro='" + intro + '\'' +
                ", isDelete=" + isDelete +
                ", version=" + version +
                ", isShareReward=" + isShareReward +
                ", isUnion=" + isUnion +
                ", merchantId=" + merchantId +
                ", name='" + name + '\'' +
                ", status=" + status +
                '}';
    }
}
